package com.neusoft.service.Impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neusoft.mapper.PasswordMapper;
import com.neusoft.service.PasswordService;
import com.neusoft.util.MD5EncryptionUtil;
import com.neusoft.vo.PasswordVO;

@Service
public class PasswordServiceImpl implements PasswordService {
	
	@Autowired
	private PasswordMapper pm;

	@Override
	public int updatePassword(PasswordVO vo) {
		//将前端上传密码进行加密处理，用来比对并设置新密码
		vo.setOldPassword(MD5EncryptionUtil.encrypted(vo.getOldPassword()));
		vo.setNewPassword(MD5EncryptionUtil.encrypted(vo.getNewPassword()));
		return pm.updatePassword(vo);
	}

}
